<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Nico: Código-Fonte de node.h</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Gerado por Doxygen 1.5.5 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Página&nbsp;Principal</span></a></li>
      <li><a href="annotated.html"><span>Estruturas&nbsp;de&nbsp;Dados</span></a></li>
      <li class="current"><a href="files.html"><span>Arquivos</span></a></li>
    </ul>
  </div>
<h1>node.h</h1><a href="node_8h.html">Vá para a documentação deste arquivo.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef _NODE_H_</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define _NODE_H_</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;stdarg.h&gt;</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 <span class="keyword">typedef</span> <span class="keywordtype">int</span> Node_type;
<a name="l00013"></a>00013 
<a name="l00014"></a>00014 <span class="comment">/* Serie de constantes que servirao para definir tipos de nos (na arvore). </span>
<a name="l00015"></a>00015 <span class="comment"> * Essa serie pode ser completada ou alterada a vontade.</span>
<a name="l00016"></a>00016 <span class="comment"> */</span>
<a name="l00017"></a>00017 <span class="preprocessor">#define code_node             298</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define declaracoes_node      299</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define declaracao_node       300</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define tipo_node             301</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define int_node              501</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="comment">/* A completar */</span>
<a name="l00023"></a>00023 
<a name="l00028"></a><a class="code" href="struct__node.html">00028</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__node.html">_node</a> {
<a name="l00029"></a><a class="code" href="struct__node.html#d9586487581d158778b8ec89f2fb321d">00029</a>    <span class="keywordtype">int</span> <a class="code" href="struct__node.html#d9586487581d158778b8ec89f2fb321d">num_line</a>;   
<a name="l00030"></a><a class="code" href="struct__node.html#d88ded3f26dc3e6469372e4740cefba7">00030</a>    <span class="keywordtype">char</span>* <a class="code" href="struct__node.html#d88ded3f26dc3e6469372e4740cefba7">lexeme</a>;   
<a name="l00031"></a><a class="code" href="struct__node.html#7d8402191946be24896b7517484c2d0b">00031</a>    Node_type <a class="code" href="struct__node.html#7d8402191946be24896b7517484c2d0b">type</a>; 
<a name="l00032"></a><a class="code" href="struct__node.html#8635514c1a76f9660692563ea9bb8ef1">00032</a>    <span class="keywordtype">void</span>* <a class="code" href="struct__node.html#8635514c1a76f9660692563ea9bb8ef1">attribute</a>;
<a name="l00033"></a>00033    <span class="comment">/* Fim das informacoes armazenadas em cada no.</span>
<a name="l00034"></a>00034 <span class="comment">    * A seguir, completar essa estrutura de dados com o necessário para</span>
<a name="l00035"></a>00035 <span class="comment">    * a implementacao dos metodos especificados.</span>
<a name="l00036"></a>00036 <span class="comment">    */</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 } <a class="code" href="struct__node.html">Node</a>;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">extern</span> <a class="code" href="struct__node.html">Node</a> * syntax_tree;
<a name="l00041"></a>00041 
<a name="l00055"></a>00055 <a class="code" href="struct__node.html">Node</a>* <a class="code" href="node_8h.html#e0463b410c4a7dbdbc4d697695726e6c">create_node</a>(<span class="keywordtype">int</span> nl, Node_type t,
<a name="l00056"></a>00056         <span class="keywordtype">char</span>* lexeme, <a class="code" href="struct__node.html">Node</a>* child0, ...);
<a name="l00057"></a>00057 
<a name="l00061"></a>00061 <span class="keywordtype">int</span> <a class="code" href="node_8h.html#a7faef607e574100e30b08bb3b00fe0d">nb_of_children</a>(<a class="code" href="struct__node.html">Node</a>* n);
<a name="l00062"></a>00062 
<a name="l00067"></a>00067 <span class="keywordtype">int</span> <a class="code" href="node_8h.html#0ca9f3a4a10bd0cd0e3a79ae8d79676e">is_leaf</a>(<a class="code" href="struct__node.html">Node</a>* n);
<a name="l00068"></a>00068 
<a name="l00076"></a>00076 <a class="code" href="struct__node.html">Node</a>* <a class="code" href="node_8h.html#e033a5706b5c6d0058874e04c9a7c180">child</a>(<a class="code" href="struct__node.html">Node</a>* n, <span class="keywordtype">int</span> i) ;
<a name="l00077"></a>00077 
<a name="l00081"></a>00081 <span class="keywordtype">int</span> <a class="code" href="node_8h.html#58649350a2079d8c22fdf5b005a82bf2">deep_free_node</a>(<a class="code" href="struct__node.html">Node</a>* n) ;
<a name="l00082"></a>00082 
<a name="l00086"></a>00086 <span class="keywordtype">int</span> <a class="code" href="node_8h.html#4af6752a1b7e972b6b108010956f41b2">height</a>(<a class="code" href="struct__node.html">Node</a> *n) ;
<a name="l00087"></a>00087 
<a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="node_8h.html#5a9c3f40eb8b282a40fc2985288596bc">uncompile</a>(FILE* outfile, <a class="code" href="struct__node.html">Node</a> *n) ;
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Gerado em Fri Sep 2 17:47:25 2011 para Nico por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>
